package gemini.castor.ui.client.page.widget.promotion;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Panel;

public class PromotionWidget extends Composite {

	@UiTemplate("PromotionWidget.ui.xml")
	interface MyUiBinder extends UiBinder<Panel, PromotionWidget> {
	}

	private static final MyUiBinder binder = GWT.create(MyUiBinder.class);

	public PromotionWidget() {
		initWidget(binder.createAndBindUi(this));
	}
	
	@UiField
	Image imgPromotion;
	
	@UiField
	HTML htmPromotionName;

	@UiField
	HTML htmPromotionDetails;
	
	public void loadData(String img, String name, String details){
		imgPromotion.setUrl(img);
		imgPromotion.setWidth("98px");
		htmPromotionDetails.setHTML(details);
		htmPromotionName.setHTML(name);
	}

}
